/**
 * @Author: wangjian
 * 656876071@qq.com
 * @Date: 2024-07-22 18:03:26
 * @LastEditTime: 2024-08-08 11:30:28
 * @FilePath: src/views/sxln/api/LnMemberApi.ts
 * @Description:
 */
import r from '@/core/utils/request'

export interface LnMemberCase {
    id?: string;
    memberId?: string;
    realName?: string;
    penName?: string;
    sex?: string;
    photo?: string;
    memberType?: string;
    entranceTime?: string;
    personProfile?: string;
    worksShow?: string;
    remark?: string;
    
    [key:string]:any
}

export const lnMemberApi = () => {
// export const lnMemberApi = () => {
    return {
        // getMemberPage: ({params = {}, current = 1, size = 10}: { params: object, current: number, size: number})=>
        getMemberPage: ({params: queryParams = {}, current = 1, size = 10}) => {
            console.debug("LnMemberApi：",queryParams)
            return r.get('/ln/member/page', {
                params: {
                    current,
                    size,
                    ...queryParams
                }
            })
        }
        ,
        getMemberById: (id: string) => {
            return r.get(`/ln/member/${id}`)
        },
        addMember:
            (rawObject: LnMemberCase) => {
                return r.post('/ln/member', rawObject)
            },
        updateMember:
            (rawObject: LnMemberCase) => {
                return r.put(`/ln/member`, rawObject)
            }
            ,
        deleteMemberById:
            (id: string) => {
                return r.delete(`/ln/member/${id}`)
            },
    }
}